import OrgStructureRolesListComp from "containers/enterprise-manage/org-structure/org-component/org-roles-list";
import DepartmentExtendFiledComp from "containers/enterprise-manage/org-structure/department-extend-filed/department-extend-filed";

import PersonDetailComp from "containers/enterprise-manage/person-manage/person-detail/person-detail";
import NewCompanyMaintainComp from "containers/enterprise-manage/company-maintain/new-company-maintain";
import CompanyExtendFiledComp from "containers/enterprise-manage/company-maintain/company-extend-filed";
import CompanyMaintainDetailComp from "containers/enterprise-manage/company-maintain/company-maintain-detail";
import NewBankAccountComp from "containers/enterprise-manage/company-maintain/new-bank-account";
import LegalPersonDetailComp from "containers/enterprise-manage/legal-person/legal-person-detail";
import NewLegalPersonComp from "containers/enterprise-manage/legal-person/new-legal-person";

import OrgStructureComp from "containers/enterprise-manage/org-structure/org-structure";
import PersonManageComp from "containers/enterprise-manage/person-manage/person-manage";
import CompanyMaintainComp from "containers/enterprise-manage/company-maintain/company-maintain";
import LegalPersonComp from "containers/enterprise-manage/legal-person/legal-person";
import ExtendFieldComp from "containers/enterprise-manage/extend-field/extend-field";

import AuthorizationHistory from 'containers/enterprise-manage/authorization-history/authorization-history';

//企业管理
const enterpriseManage = {
  key:'enterprise-manage',
  icon: 'setting',
  admin: true,
  subMenu: [
    //组织架构
    {
      key:'org-structure',
      url:'/main/enterprise-manage/org-structure',
      components: OrgStructureComp ,
      parent: 'enterprise-manage',
      fpItem: ["companyManage.organization.disabled"],
      fpValue: [[false,undefined]],
      //部门角色
      children: {
        orgStructureRolesList: {
          key:'org-roles-list',
          url:'/main/enterprise-manage/org-structure/org-roles-list',
          components: OrgStructureRolesListComp ,
          parent: 'org-structure',
        },
        //部门扩展字段
        DepartmentExtendFiled: {
          key:'department-extend-filed',
          url:'/main/enterprise-manage/org-structure/department-extend-filed',
          components: DepartmentExtendFiledComp ,
          parent: 'org-structure',
        },
      }
    },
    //法人实体
    {
      key:'legal-person',
      url:'/main/enterprise-manage/legal-person',
      components: LegalPersonComp ,
      parent: 'enterprise-manage',
      fpItem: ["companyManage.legalEntity.disabled"],
      fpValue: [[false,undefined]],
      tenant: true,

      children: {
        legalPersonDetail: {
          key:'legal-person-detail',
          url:'/main/enterprise-manage/legal-person/legal-person-detail/:legalPersonOID/:legalPersonID',
          components: LegalPersonDetailComp ,
          parent: 'legal-person',
        },
        newLegalPerson: {
          key:'new-legal-person',
          url:'/main/enterprise-manage/legal-person/new-legal-person',
          components: NewLegalPersonComp ,
          parent: 'legal-person',
        },
        editLegalPerson: {
          key:'edit-legal-person',
          url:'/main/enterprise-manage/legal-person/edit-legal-person/:legalPersonOID/:legalPersonID',
          components: NewLegalPersonComp ,
          parent: 'legal-person',
        }
      }
    },
    //公司维护
    {
      key:'company-maintain',
      url:'/main/enterprise-manage/company-maintain',
      components:CompanyMaintainComp,
      parent: 'enterprise-manage',
      tenant: true,
      oldCompany: 'NEW_ONLY',
      children:{
        //新建公司
        newCompanyMaintain: {
          key:'new-company-maintain',
          url:'/main/enterprise-manage/company-maintain/new-company-maintain/:flag/:companyOID',
          components:NewCompanyMaintainComp,
          parent:'company-maintain'
        },
        //编辑公司与新增公司是同一个组件，这里不需要维护两个路由
        // updateCompanyMaintain:
        //公司维护详情
        companyMaintainDetail: {
          key:'company-maintain-detail',
          url:'/main/enterprise-manage/company-maintain/company-maintain-detail/:companyOId/:companyId',
          components:CompanyMaintainDetailComp,
          parent: 'company-maintain'
        },
        //新建银行账户
        newBankAccount: {
          key:'new-bank-account',
          url:'/main/enterprise-manage/company-maintain/new-bank-account/:companyOId/:companyId/:flag',
          components:NewBankAccountComp,
          parent: 'company-maintain'
        },
        //编辑银行账户与新增银行账户是同一个组件，这里不需要维护两个路由
        // updateBankAccount:

        //公司扩展字段
        CompanyExtendFiled: {
          key:'company-extend-filed',
          url:'/main/enterprise-manage/company-maintain/company-extend-filed',
          components: CompanyExtendFiledComp ,
          parent: 'company-maintain',
        }

      }
    },
    //人员管理
    {
      key: 'person-manage',
      url: '/main/enterprise-manage/person-manage',
      components: PersonManageComp,
      parent: 'enterprise-manage',
      fpItem: ["companyManage.employee.disabled"],
      fpValue: [[false, undefined]],
      //人员详情
      children: {
        personDetail: {
          key: 'person-detail',
          url: '/main/enterprise-manage/person-manage/person-detail/:userOID',
          components: PersonDetailComp,
          parent: 'person-manage',
        },
        extendField: {
          key: 'extend-field',
          url: '/main/enterprise-manage/person-manage/extend-field',
          components: ExtendFieldComp,
          parent: 'person-manage',
        }
      },
    },
    {
      key: 'authorization-history',
      url: '/main/enterprise-manage/authorization-history',
      components: AuthorizationHistory,
      parent: 'enterprise-manage',
      // fpItem: ["companyManage.employee.disabled"],
      // fpValue: [[false, undefined]],
    }
  ]
};

export default enterpriseManage;
